/*
 * @Author: 白袂 1741866590@qq.com
 * @Date: 2023-09-04 21:17:03
 * @LastEditors: 白袂 1741866590@qq.com
 * @LastEditTime: 2023-09-17 21:17:08
 * @FilePath: \obj_system\src\router\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import Vue from 'vue'
import VueRouter from 'vue-router'

//导入路由配置
import Login from "./login"
import Sign from "./sign"
import Home from "./home"



// 禁用重复导航报错
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
Vue.use(VueRouter)

const routes = [
    Login,    //登录页
    Sign,   //注册页
    Home,    //主页
    {
        path:"*",
        redirect:"/login"
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router